from django.urls import path
from .views import (
    CourseCategoryListView,
    CourseCollectionListView,
    CourseCollectionDetailView,
    MyCourseCollectionsView,
    CreateCourseCollectionView,
    UploadVideoToCollectionView,
    CommentCourseCollectionView,
    ToggleCourseLikeView,
    BuyCourseCollectionView
)

urlpatterns = [
    # 分类相关
    path('categories/', CourseCategoryListView.as_view(), name='course-category-list'),

    # 合集列表 & 详情
    path('collections/', CourseCollectionListView.as_view(), name='course-collection-list'),
    path('collections/<int:pk>/', CourseCollectionDetailView.as_view(), name='course-collection-detail'),

    # 我的合集 & 创建合集
    path('my_collections/', MyCourseCollectionsView.as_view(), name='my-course-collections'),
    path('collections/create/', CreateCourseCollectionView.as_view(), name='create-course-collection'),

    # 视频上传到合集
    path('collections/<int:collection_id>/upload_video/', UploadVideoToCollectionView.as_view(), name='upload-course-video'),

    # 点赞、评论合集
    path('collections/<int:pk>/like/', ToggleCourseLikeView.as_view(), name='like-course-collection'),
    path('collections/<int:pk>/comment/', CommentCourseCollectionView.as_view(), name='comment-course-collection'),

    # 购买课程
    path('collections/<int:pk>/buy/', BuyCourseCollectionView.as_view(), name='buy-course-collection'),
]
